package com.ruoyi.common.core.domain.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 * @author lingyu
 * @date 2024-03-04
 */
public class YxDeviceUseTimeVo
{
    private static final long serialVersionUID = 1L;
    private static final Map<Integer,String> keyWeekMap = new HashMap();

    static {
        keyWeekMap.put(0,"周一");
        keyWeekMap.put(1,"周二");
        keyWeekMap.put(2,"周三");
        keyWeekMap.put(3,"周四");
        keyWeekMap.put(4,"周五");
        keyWeekMap.put(5,"周六");
        keyWeekMap.put(6,"周日");
    }

    /**
     * 设备 应用 id
     */
    public Long daId;


    /**
     * 重复天数
     */
    private List<WeekDays> dayOfweek;


    /**
     * 时间段
     */
    private List<YxAvailaleTimeVo> timeRanges;

    public String getWeekDayByKey(int key){
        return keyWeekMap.get(key);
    }


    public List<WeekDays> getDayOfweek() {
        return dayOfweek;
    }

    public void setDayOfweek(List<WeekDays> dayOfweek) {
        this.dayOfweek = dayOfweek;
    }

    public List<YxAvailaleTimeVo> getTimeRanges() {
        return timeRanges;
    }

    public void setTimeRanges(List<YxAvailaleTimeVo> timeRanges) {
        this.timeRanges = timeRanges;
    }

    public static class YxAvailaleTimeVo{
        /** 开始时间 */
        public String startTime;

        /** 结束时间 */
        public String endTime;
    }

    public static class WeekDays{
        /** 名称 */
        public String name;

        /** 是否选中 */
        public boolean active;

        /** key值 */
        public int key;

        public void setKey(int key) {
            this.key = key;
            this.name = keyWeekMap.get(key);
        }
    }
}
